<!-- Author:Rain -->
<template>
    <div data-v-132c1892="" class="new-guide-common__cont">
        <div data-v-132c1892="" class="new-guide-common__title"> 实习经历 4/6 </div>
        <div data-v-132c1892="" class="new-guide-common__progress">
            <div data-v-132c1892="" class="new-guide-common__progress-inner" style="width: 328px;"></div>
        </div>
        <div data-v-132c1892="" class="page-loading" style="display: none;">正在加载中...</div>
        <div data-v-63454d00="" data-v-132c1892="" class="new-guide-work-info" style="">
            <form data-v-63454d00="" autocomplete="off" class="ui-form ui-form-label-top">
                <div data-v-63454d00="" class="form-item form-item-required form-item-error" ka="work-position">
                    <div class="item-label">你最近工作的职位是</div>
                    <div class="item-content">
                    <div data-v-63454d00="" class="input-wrap input-wrap-text" ka="resume_form_edit_position">
                        <!----><!----><input v-model="type" autocomplete="on" spellcheck="false" type="text" placeholder="选择职位类型"
                             class="input"><!----><span class="suffix"><svg data-v-9a6c7f86=""
                                data-v-63454d00="" aria-hidden="true" class="svg-icon"
                                style="width: 10px; height: 6px;">
                                <use data-v-9a6c7f86="" xlink:href="#icon-guide-arrow-down"></use>
                            </svg></span><!----><!----></div><!---->
                </div>
            </div>
            <div data-v-63454d00="" class="form-item form-item-required form-item-error" ka="work-company">
                <div class="item-label">你最近就职的公司是（将自动屏蔽该公司下的Boss）</div>
                <div class="item-content">
                    <div data-v-63454d00="" class="ui-suggest ui-select ui-dropmenu" placeholder="例如： 北京华品博睿网络技术有限公司"
                        clearable="">
                        <div class="ui-dropmenu-label">
                            <div class="ui-suggest-input input-wrap input-wrap-text"><!----><!----><input
                                    v-model="company"
                                    autocomplete="on" spellcheck="false" type="text" placeholder="例如： 北京华品博睿网络技术有限公司"
                                    class="input"><!----><!----><!----><!----></div><!----><!---->
                        </div>
                        <div class="ui-dropmenu-list"></div>
                    </div><!---->
                </div>
            </div>
            <!-- 表单项 -->
            <RainTime @sendTime="hh" style="width: 100%;"  title="开始时间" :value="splitTimeToV(undergo.start)"/>
            <RainTime  @sendTime="jj" title="结束时间" :value="splitTimeToV(undergo.end)"/>
        </form><!---->
    </div>
</div></template>

<script setup lang="ts">
import { RainTime} from "@/components/formitems/index"
import splitTimeToV from "@/utils/todo"
let type=ref("")
let company=ref("")
let undergo=reactive({
    start:'',
    end:""
})

onActivated(() => {
    // 调用时机为首次挂载
    // 以及每次从缓存中被重新插入时
    let guideInfo = JSON.parse(localStorage.getItem("guideInfo") as string)
    //去本地存储中把数据取出来！！！
    let { "guide-4": guide4 } = guideInfo
    type.value=guide4.type
    company.value=guide4.company
    Object.assign(undergo,guide4.undergo)
})


onDeactivated(() => {
    //写入本地存储
    let guideInfo = JSON.parse(localStorage.getItem("guideInfo") as string)
    guideInfo["guide-4"] = {
        type: type.value,
        undergo:markRaw(undergo),
        company: company.value
    }
    
    localStorage.setItem("guideInfo", JSON.stringify(guideInfo))
})

function hh(value:any){
    let {year,month}=value
    undergo.start=year+"-"+month
}
function jj(value :any){
    let {year,month}=value
    undergo.end=year+"-"+month
}

</script>

<style scoped>
@import url("@/assets/guideCommon.css");

</style>